package org.scrumfx.value;

import java.util.Date;
import static org.junit.Assert.*;

import org.scrumfx.bean.Project;

public class ProjectValue
{
  public static Project createProject(int id, String longName,
      String shortName, int status, Date startDate, Date endDate)
  {
    Project project = new Project();
    project.setId(id);
    project.setLongName(longName);
    project.setShortName(shortName);
    project.setStatus(status);
    project.setStartDate(startDate);
    project.setEndDate(endDate);
    return project;
  }

  public static Project createProjectByLongNameShortNameAndStatus(
      String longName, String shortName, int status)
  {
    return createProject(0, longName, shortName, status, null, null);
  }

  public static void assertProject(Project expected, Project actual)
  {
    assertProject("", expected, actual);
  }

  public static void assertProject(String message, Project expected, Project actual)
  {
    if (expected == null)
    {
      assertNull(message + "[should be null]", actual);
    }
    else
    {
      assertNotNull(message + "[should not be null]", actual);
      assertEquals(message + "[id]", expected.getId(), actual.getId());
      assertEquals(message + "[longName]", expected.getLongName(), actual.getLongName());
      assertEquals(message + "[shortName]", expected.getShortName(), actual.getShortName());
      assertEquals(message + "[status]", expected.getStatus(), actual.getStatus());
      assertEquals(message + "[startDate]", expected.getStartDate(), actual.getStartDate());
      assertEquals(message + "[endDate]", expected.getEndDate(), actual.getEndDate());
    }
  }
}
